<?#//v.3.1.1
#///////////////////////////////////////////////////////
#//  COPYRIGHT 2004 Phpauction.org ALL RIGHTS RESERVED//
#///////////////////////////////////////////////////////

require('../includes/config.inc.php');
include "loggedin.inc.php";
include $include_path.'time.inc.php';

unset($ERR);

#//
if($_POST[action] == "update"  && phpa_securepost($_POST))
{
	if(!is_numeric($_POST[archiveafter]))
	{
		$ERR = "Incorect field format: must be numeric";
		$SETTINGS = $_POST;
	}
	else
	{
		#// Update database
		$query = "update PHPAUCTIONXL_settings set
					  cron=$_POST[cron],
					  archiveafter=".intval($_POST[archiveafter]);;
		$res = @mysql_query($query);
		if(!$res)
		{
			print "Error: $query<BR>".mysql_error();
			exit;
		}
		else
		{
			$ERR = $MSG_378;
			$SETTINGS = $_POST;
		}
	}
}
else
{
	#//
	$query = "SELECT * FROM PHPAUCTIONXL_settings";
	$res = @mysql_query($query);
	if(!$res)
	{
		print "Error: $query<BR>".mysql_error();
		exit;
	}
	elseif(mysql_num_rows($res) > 0)
	{
		$SETTINGS = mysql_fetch_array($res);
	}
}

?>
<HTML>
<HEAD>
<link rel='stylesheet' type='text/css' href='style.css' />
<link href="css/main.css" rel="stylesheet" type="text/css">
</HEAD>
<body bgcolor="#FFFFFF" text="#000000" link="#0066FF" vlink="#666666" alink="#000066" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="titulo">
        <tr> 
          <td class="icono"><img src="images/settings_icon2.gif" width="30" height="29"></td>
          <td class="breadcrumbs"><p><span><?=$MSG_25_0007?></span>&nbsp;&gt;&gt;&nbsp;<?=$MSG_348?></p></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
    <tr> 
    <td align="center" valign="middle">
<TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0 BGCOLOR="#FFFFFF">
<TR>
<TD>
<CENTER>
<BR>
<FORM NAME=conf ACTION=<?=basename($_SERVER['PHP_SELF'])?> METHOD=POST>
<TABLE WIDTH="95%" BORDER="0" CELLSPACING="0" CELLPADDING="0" class="base" align="center">
	<TR>
		<TD ALIGN=CENTER class=title>
			<p><? print $MSG_348; ?></p>		</TD>
	</TR>
	<TR>
		<TD><table width=100% cellpadding=0  cellspacing="0" style="border:1px solid #ccc;">
          <?
			if(isset($ERR))
			{
			?>
          <tr bgcolor=yellow>
            <td class=error colspan="2" align=CENTER><p> <? print $ERR; ?></p></td>
          </tr>
          <?
			}
			 ?>

                <input type="hidden" name="cron" value="2">
             
          <tr valign="TOP">
            <td width=125 class="gris"  height="35"><p class="blue"><? print $MSG_376; ?></p></td>
            <td width="375" class="gris"  height="35"><input type="text" name="archiveafter" size="4" maxlength="4" value="<?=$SETTINGS[archiveafter]?>">
                <? print $MSG_377; ?> </td>
          </tr>
          <tr>
            <td width=125 ><INPUT TYPE="hidden" NAME="action" VALUE="update" /> <INPUT TYPE="hidden" NAME="security" VALUE="<?php echo $_SESSION['security'];?>" />            </td>
            <td width="375"  ><input type="submit" name="act" value="<? print $MSG_530; ?>" class="action">            </td>
          </tr>
          <tr>
            <td width=125 ></td>
            <td width="375" ></td>
          </tr>
        </table></TD>
	</TR>
</TABLE>
</FORM>

</TD>
</TR>
</TABLE>

</TD></TR>
</TABLE>
</BODY>
</HTML>